package whisper.service.auth.shiro.realm;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;

/**
 * Created by JT on 2018/5/29
 */
public abstract class AbstractRealm extends AuthorizingRealm {

    /**
     * 授权调用
     * @param principal
     * @return
     */
    @Override
    protected abstract AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principal);

    /**
     * 登录调用
     * @param token
     * @return
     * @throws AuthenticationException
     */
    @Override
    protected abstract AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token);


}
